//
//  FRLiveCell.m
//  Live
//
//  Created by 徐芙蓉 on 2017/8/10.
//  Copyright © 2017年 Afra. All rights reserved.
//

#import "FRLiveCell.h"

@interface FRLiveCell ()
@property (weak, nonatomic) IBOutlet UIImageView *headView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *locationLabel;
@property (weak, nonatomic) IBOutlet UILabel *onLineLabel;

@property (weak, nonatomic) IBOutlet UIImageView *bigImageView;

@end

@implementation FRLiveCell

-(void)setLive:(FRLive *)live
{
    _live = live;
    self.locationLabel.text = live.city;
    self.onLineLabel.text = [@(live.onlineUsers) stringValue];
    if ([live.creator.portrait isEqualToString:@"focus"]) {
        self.headView.image = [UIImage imageNamed:@"focus"];
        self.bigImageView.image = [UIImage imageNamed:@"focus"];
    } else {
        [self.headView downloadImage:live.creator.portrait placeholder:@"default_room"];
        //    [self.bigImageView downloadImage:[NSString stringWithFormat:@"%@%@",IMAGE_HOST,live.creator.portrait] placeholder:@"default_room"];
        [self.bigImageView downloadImage:live.creator.portrait placeholder:@"default_room"];
    }
        self.nameLabel.text = live.creator.nick;

    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headView.layer.cornerRadius = 25;
    self.headView.layer.masksToBounds = YES;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
